package com.hitales.liteflow.liteflowdemo.overwritedemo;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;

@LiteflowComponent("checkUser")
public class CheckUserCmp extends NodeComponent {

    // 决定是否允许执行该节点
    @Override
    public boolean isAccess() {
        String user = this.getRequestData();
        return user != null && user.startsWith("admin");
    }

    @Override
    public void beforeProcess() {
        super.beforeProcess();
    }

    @Override
    public void process() {
        System.out.println("checkUser executed, data=" + this.getRequestData());
    }

    @Override
    public void afterProcess() {
        super.afterProcess();
    }
}
